package wql.demo05;

/**
 * @author wql
 * @version 1.0
 * @date 2022/10/25 14:41
 */

public class Need {
    public static void main(String[] args) {
        fruit<String> fruit = new fruit<>();
        fruit.eat("无敌");

        vegetable vegetable = new vegetable();
        vegetable.eat(123);
    }
}
interface food<T>{
    public void eat(T t);
}
class  fruit<T> implements food<T>{

    @Override
    public void eat(T t) {
        System.out.println("泛型类");
        System.out.println("t = " + t);
    }
}
class vegetable implements food<Integer>{

    @Override
    public void eat(Integer integer) {
        System.out.println("类不是泛型类");
        System.out.println("integer = " + integer);
    }
}
